﻿using MediatR;
using T_vehicle.Domain;
using T_vehicle.Infrastructure.Interfacec;
using T_vehicle.Read.API.Application.Command.IllegalCommand;

namespace T_vehicle.Read.API.Application.CommandHandlers.IllegalCommandHandlers
{
    public class FanIllgalCommandHandlers : IRequestHandler<FanIllgalCommand, Illegal>
    {
        private readonly IIllegalRepository illegalRepository;

        public FanIllgalCommandHandlers(IIllegalRepository illegalRepository)
        {
            this.illegalRepository = illegalRepository;
        }

        public async Task<Illegal> Handle(FanIllgalCommand request, CancellationToken cancellationToken)
        {
            var list = illegalRepository.GetModelAsync(request.IllegalId);
            return await list;

        }
    }
}
